package com.htfyun.eink.pw.draw.pen.epd.marker;

import com.htfyun.eink.pw.draw.pen.epd.EPDBaseManager;
import com.htfyun.eink.pw.draw.pointer.PWPointer;

public class MarkerManager extends EPDBaseManager {

    private final MarkerParam param = new MarkerParam();

    @Override
    public void onDown(PWPointer point) {

    }

    @Override
    public void onMove(PWPointer point) {
        float pressure = point.pressure;
        float size = param.width;
        if (pressure <= 0.3f) {
            size = param.width * 0.8f;
        } else if (pressure <= 0.6f) {
            size = param.width * 0.9f;
        }

        renderPoints.add(createRenderPointerBy(point, size));
    }

    @Override
    public void onUp(PWPointer point) {

    }

    @Override
    public void setStrokeWidth(float strokeWidth) {
        param.setStrokeWidth(strokeWidth);
    }

}
